home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 1 / Meeting Pearls Vol 1 (1994).iso / installed_progs / util / pgp / pgpamiga / pgp-installer-script < prev    next >
Encoding:
Text File  |  1994-05-30  |  24.5 KB  |  767 lines

  1. ; PGP Installer script
  2. ; $VER: PGP-Installer 0.7 for 2.3a.3 (30.5.94)
  3.  
  4. ; ***********************************************************
  5. ; * Basic PGP v2.3a.2 Installation
  6. ; *
  7. ; * Installs PGP, support files, and AmigaGuide documentation
  8. ; *
  9. ; * by Jacob Ellis <jellis@nah.oau.org>
  10. ; *
  11. ; *
  12. ; * Tries to be smart about where files should go, especially
  13. ; * if upgrading from a previous version of PGP.
  14. ; *
  15. ; * I have tried my best to work around some of the limitations
  16. ; * of Installer, which while powerful in some ways, it is extremely
  17. ; * limited in others (very annoying!!!). Hopefully you'll think
  18. ; * the results are worthwhile.
  19. ; *
  20. ; *
  21. ; * Note: Unlike many Installer scripts, the novice install
  22. ; *       is truly fully automatic (as per the Installer
  23. ; *       manual). Don't panic though, it'll make good guesses on
  24. ; *       where things should go (IMHO). And, as you might expect,
  25. ; *       expert install truly does require you to confirm
  26. ; *       EVERY action.
  27. ; *
  28. ; *
  29. ; *
  30. ; ***********************************************************
  31. ; *
  32. ; * Limitations:
  33. ; *
  34. ; *     Required OS 2.04 or better (this isn't a limitation
  35. ; *     in my opinion!). This is simply because I was too
  36. ; *     lazy to ask the 1.3 user where they keep ENVARC: (and what
  37. ; *     a hassle if they don't have an ENVARC:!)
  38. ; *
  39. ; *     Only supports English (but does install the PGP
  40. ; *     extra language files). Support is in for other languages,
  41. ; *     but this will require someone to translate the text
  42. ; *     messages (I have to say I am very disappointed on how
  43. ; *     well Installer supports other languages).
  44. ; *
  45. ; *    Does not currently install any extras. Installer does
  46. ; *     not support lists (as far as I can tell), which means
  47. ; *     each filename must be specified (unless, of course,
  48. ; *     you just wanted to copy whole directories) individually
  49. ; *     each time you want to do something with it.
  50. ; *
  51. ; *     Will only install PGP v2.3a.2 reliably, this script
  52. ; *     should abort on any other version of PGP. Expert user
  53. ; *     can override this.
  54. ; *
  55. ; *    The method used to determine if an older version of PGP
  56. ; *     is being installed is very weak (ie. file date), but
  57. ; *     better than nothing.
  58. ; *
  59. ; *    Other minor limitations may exist where I got lazy.
  60. ; *
  61. ; ***********************************************************
  62. ; *
  63. ; * General Program Outline:
  64. ; *
  65. ; * Note: Novice users are not asked anything. Defaults for them
  66. ; *       are set to the logic outlined below.
  67. ; *
  68. ; *     1. Check if ENV:PGP exists.
  69. ; *         A) Yes, get ENV:PGPPATH for directions.
  70. ; *                Check path for directions to PGP binary.
  71. ; *        B) No, looks like a new install. Use default settings.
  72. ; *
  73. ; *     2. Ask user where PGP and support should be installed.
  74. ; *         A) Look if PGP might exist there.
  75. ; *             i)  Yes, assume an upgrade, use current settings.
  76. ; *             ii) No, assume new install.
  77. ; *
  78. ; *     3. Check if AmigaGuide is installed.
  79. ; *         A) Yes, find most logical place for AmigaGuide files.
  80. ; *                     i)  ENV:AmigaGuide/Path
  81. ; *                     ii) Check OS versions
  82. ; *                 a) => OS 2.1 then HELP:@language
  83. ; *                 b) < OS 2.1 then S:
  84. ; *               iii) Ask for user override
  85. ; *             B) No, copy AmigaGuide documentation with support files.
  86. ; *
  87. ; *     4. Check if PGP to install is older than PGP already installed.
  88. ; *             A) Yes, ask if user wants to abort.
  89. ; *             B) No, continue install.
  90. ; *
  91. ; *     5. Upgrading from a previous version?
  92. ; *             A) Yes, ask if user wants new configuration.
  93. ; *                     i) Yes, install new configuration.
  94. ; *                    ii) Yes, backup old configuration, then install new.
  95. ; *             B) No, keep old configuration.
  96. ; *
  97. ; *     6. Install files to selected destinations.
  98. ; *
  99. ; *     7. New installation?
  100. ; *             A) Yes, set ENV: and ENVARC: to match installed settings.
  101. ; *             B) No, leave ENV: and ENVARC: alone.
  102. ; *
  103. ; *     8. View readme
  104. ; *             A) OS => 3.0 then use Multiview
  105. ; *             B) OS < 3.0 then use More
  106. ; *
  107. ; *
  108. ; ***********************************************************
  109. ; *
  110. ; * History
  111. ; *
  112. ; * 0.1    Initial version (24.2.94)
  113. ; *
  114. ; * 0.2 Minor cleanup (25.2.94)
  115. ; *          + Accidently left some old debug code in
  116. ; *
  117. ; * 0.3 Minor fix for OS 2.04 users (26.2.94)
  118. ; *          + Novice OS 2.04 users that added AmigaGuide and
  119. ; *        did not bother to specify a location for
  120. ; *             AmigaGuide files would end up with their
  121. ; *        PGP AmigaGuide files in HELP:(language).
  122. ; *        This now defaults to S: (same as AmigaGuide) if
  123. ; *             no other more logical location can be found.
  124. ; *           + Added history section
  125. ; *           + Added more comments to obscure sections
  126. ; *           + Fixed prompt and help messages for AmigaGuide
  127. ; *             installation.
  128. ; *           + Added % complete indicators
  129. ; *
  130. ; * 0.4 Minor fix for ENV: and ENVARC: paths (28.2.94)
  131. ; *           + ENV: and ENVARC: variables are now forced to use
  132. ; *             absolute paths. Previously, a relative path could
  133. ; *        be specified.
  134. ; *
  135. ; * 0.5 Minor change to account for upgrading users (1.3.94)
  136. ; *     Major change to account for workbench users
  137. ; *           + Discovered major problem with the script if run
  138. ; *        from Workbench. Workbench only gives the
  139. ; *        Installer the default system path, this consists
  140. ; *        of Current_dir and C:. This is not acceptable,
  141. ; *        so the script is now an IconX script that calls
  142. ; *             Installer. This seems to have solved the problem,
  143. ; *             but I wish there was a neater way to do this. :(
  144. ; *           + A user who upgrades from a previous version of PGP
  145. ; *             and wishes to install PGP in a new location could
  146. ; *             cause PGP to get confused about what it should do
  147. ; *             with the old configuration file. PGP-Install now
  148. ; *             treats a user in this class as a completely new install,
  149. ; *             rather than as an upgrade (so they get a new Config
  150. ; *             file in the new location and their old Config is not
  151. ; *             touched).
  152. ; *          + Added program outline for those curious about PGP-Install's
  153. ; *             logic and reasoning. This is really to explain why
  154. ; *        PGP-Install chooses where things go, and to help
  155. ; *             you identify what went wrong if PGP-Install should
  156. ; *        break on your configuration.
  157. ; *
  158. ; * 0.6 Major fix for AmigaGuide path finding logic (2.3.94)
  159. ; *     Major change for PGP revision finding code
  160. ; *           + If your ENV:AmigaGuide/Path variable contains
  161. ; *             multiple paths or leading spaces (shame on you),
  162. ; *             PGP-Install can now extract a readable path from
  163. ; *             that variable.
  164. ; *           + Installer has trouble understanding PGP's version
  165. ; *             string, so the method for determining an out of date
  166. ; *             version of PGP is changed. It is now based on file date
  167. ; *             and size. Obviously, this could have a lot of problems,
  168. ; *             but it's better than nothing. :)
  169. ; *
  170. ; * 0.7 Major change for PGP integrity check (30.5.94)
  171. ; *           + The check now does MD5SUM checking instead of the
  172. ; *             older Installer getsum() method. The entire archive
  173. ; *             is now checked in less than the time it took to check
  174. ; *             just the PGP binary with the old method.
  175. ; *           + Updated files for PGP Amiga 2.3a.3
  176. ; *
  177. ; ***********************************************************
  178.  
  179.  
  180.  
  181. ; ***********************************************************
  182. ; * Set APPNAME if started directly from shell
  183. ; * Note: this is broken!
  184. ; ***********************************************************
  185.  
  186. (set @app-name "PGP 2.3a.3")
  187.  
  188. (set osver (/ (getversion) 65536)) ; get OS version
  189.  
  190.  
  191.  
  192. ; ***********************************************************
  193. ; * Important file names and stuff to be installed
  194. ; * This applies ONLY to 2.3a.3
  195. ; ***********************************************************
  196.  
  197. (set newpgpbin "bin/PGP")
  198. (set newpgpbinsum 1659748947)
  199. (set newpgpbinsize 152260)
  200.  
  201. ; Unforunately, Installer does not seem to be able to deal with
  202. ; lists. So each file must be listed individually (yuck!).
  203.  
  204. ; Misc files
  205.  
  206. ; "bin/es.hlp" "bin/fr.hlp" "bin/keys.asc" "bin/language.txt" "bin/pgp.hlp"
  207.  
  208. ; "doc/keyserv.doc" "doc/newfor22.doc" "doc/newfor23.doc" "doc/pgformat.doc" "doc/PGP.faq" "doc/politic.doc" "doc/readme.doc" "doc/setup.doc"
  209.  
  210. ; AmigaGuide files
  211. ; "doc/pgpdoc1.guide" "doc/pgpdoc2.guide"
  212.  
  213.  
  214. (set pgpconfig "PGP.config")
  215. (set newpgpconfig (tackon "bin/" pgpconfig))
  216.  
  217.  
  218.  
  219. ; ***********************************************************
  220. ; * Check to make sure English is the language used here
  221. ; * Other languages will hopefully be supported in the future
  222. ; ***********************************************************
  223.  
  224. (if(= @language "english")
  225.  
  226.     ; Set up strings for English usage
  227.         (
  228.      (set #yes "Yes")
  229.      (set #no "No")
  230.  
  231.      (set #already-installed (cat
  232.                 @app-name " appears to already be installed.\n"
  233.         "Do you wish to install anyway?")
  234.      )
  235.      (set #already-installed-help (cat
  236.                 @app-name " appears to already be installed.")
  237.      )
  238.      (set #already-installed-abort (cat
  239.         @app-name " already installed.\nAborting install.")
  240.      )
  241.  
  242.      (set #old-installed (cat
  243.                 "You seem to be attempting to install an older"
  244.         " version of PGP. Installation of an older"
  245.         " version of PGP is not recommended. Do you wish"
  246.         " to continue?")
  247.      )
  248.      (set #old-installed-help (cat
  249.         @app-name " may not be the latest version of PGP. "
  250.         " You are strongly adviced to examine this archive"
  251.         " and your currently installed version of PGP"
  252.         " more closely.")
  253.      )
  254.      (set #old-installed-abort (cat
  255.         @app-name " may be out of date. Please check your"
  256.         " currently installed version of PGP and examine "
  257.         " the PGP included in this archive more closely.")
  258.      )
  259.  
  260.  
  261.      (set #pgp-bin-prompt (cat
  262.         "Please choose where to install the " @app-name
  263.             " program binary.")
  264.          )
  265.      (set #pgp-bin-help (cat
  266.         "This is where the " @app-name " binary will"
  267.                 " be installed. Ideally, it should be somewhere"
  268.         " in your shell path.")
  269.      )
  270.  
  271.      (set #pgp-ag-prompt (cat
  272.         "Please choose where to install the " @app-name
  273.         " AmigaGuide® documentation.")
  274.      )
  275.      (set #pgp-ag-help (cat
  276.         "This should be where you normally keep your"
  277.         " AmigaGuide® help files and documentation.\n\n"
  278.         "AmigaGuide® is the Amiga hypertext help system.")
  279.      )
  280.  
  281.      (set #pgp-path-prompt (cat
  282.         "Please choose where to install the " @app-name
  283.         " configuration and support files.")
  284.      )
  285.          (set #pgp-path-help (cat
  286.         "This is where files necessary to " @app-name
  287.                 " will be installed. These files include the"
  288.                 " configuration file, language files, internal"
  289.         " help, as well as the PGP keyrings.\n\n"
  290.         "These files do not have to be located in the"
  291.         " same place as the binary.")
  292.      )
  293.  
  294.      (set #config-backup-prompt (cat
  295.         "Do you wish to overwrite your current PGP configuration"
  296.         " with the new one from this archive? (Not"
  297.         " recommended.)")
  298.      )
  299.          (set #config-backup-help (cat
  300.                 "In most cases, this is not necessary. The configuration"
  301.         " file has changed very little (if at all) from previous"
  302.                 " versions of PGP.\nI would, however, recommend that you"
  303.         " read the the PGP documentation for any information on"
  304.         " important configuration file changes.")
  305.      )
  306.      (set #config-backup-choices1 (cat
  307.                 #no ".")
  308.      )
  309.          (set #config-backup-choices2 (cat
  310.                 #yes ".")
  311.      )
  312.          (set #config-backup-choices3 (cat
  313.         #yes ", but backup my old configuration first!")
  314.      )
  315.  
  316.  
  317.      (set #working-pgp-bin (cat
  318.         "Installing " @app-name " binary.")
  319.      )
  320.          (set #working-pgp-etc (cat
  321.         "Installing " @app-name " support files.")
  322.      )
  323.      (set #working-config-backup (cat
  324.         "Backing up old configuration.")
  325.      )
  326.      (set #working-ag (cat
  327.         "Installing " @app-name " AmigaGuide® hypertext"
  328.         " help files.")
  329.      )
  330.  
  331.      (set #asksumming-prompt (cat
  332.         "Should the data integrity of " @app-name
  333.         " be checked before attempting to install?\n\n"
  334.         "(This is recommended.)")
  335.          )
  336.      (set #asksumming-help (cat
  337.         "This will calculate an MD5SUM checksum for the "
  338.         @app-name " archive and compare it with known values.\n\n"
  339.         "This will take a few moments,"
  340.         " depending on the speed of your system.")
  341.      )
  342.      (set #pgpsumming (cat
  343.         "Checking the integrity of " @app-name "."
  344.         "\n\nThis may take a few moments, depending on the"
  345.         " speed of your system.")
  346.      )
  347.      (set #badpgpmsg (cat
  348.         "WARING: This version of " @app-name " is"
  349.                 " incorrect, damaged, or has been tampered with. Please check the"
  350.         " archive and the archive source carefully. If you"
  351.         " suspect the archive has been modified please contact"
  352.         " Peter Simons <simons@peti.GUN.de> immediately!")
  353.      )
  354.  
  355.      (set #working-env-prompt (cat
  356.         "Creating enviroment variable for " @app-name
  357.         ".")
  358.      )
  359.      (set #working-env-help (cat
  360.         "This will create the necessary enviroment variables"
  361.         " for the proper operation of " @app-name ".")
  362.      )
  363.  
  364.      (set #bad-os (cat
  365.         "PGP-Install requires OS 2.04 or newer.\n\n"
  366.         "Time to upgrade your system!")
  367.      )
  368.  
  369.      (set #ask-view-prompt (cat
  370.         "Do you wish to read the ReadMe.Amiga file for "
  371.         @app-name " now?\n\n"
  372.                 "(This is recommended.)")
  373.      )
  374.          (set #ask-view-help (cat
  375.         "This will display some important information you should"
  376.         " know about " @app-name ". It is a good idea to read"
  377.         " this before attempting to use the program.")
  378.      )
  379.  
  380.  
  381.     )
  382.  
  383.     ; Complain that English wasn't chosen as the language
  384.     (
  385.      (abort (cat "At present the PGP-Installer currently only"
  386.                  " supports English. In the future there will"
  387.                      " hopefully be more support for other languages."
  388.                      " My apologies for the inconvenience.\n\n"
  389.                      "If you would like to help support a version of"
  390.                      " the PGP-Installer in your language, please"
  391.                      " contact me (Jacob Ellis <jellis@nah.oau.org>)"
  392.                      " or Peter Simons <simons@peti.GUN.de> for more"
  393.                      " information. Thank you!")
  394.      )
  395.     )
  396. ) ;endif not-english
  397.  
  398.  
  399.  
  400. ; ***********************************************************
  401. ; * start installer
  402. ; ***********************************************************
  403.  
  404. (if (< osver 37) ; Make sure OS 2.04 is running
  405.     (abort #bad-os) ; abort if not OS 2.04
  406. )
  407.  
  408. (welcome) ; start the main installer procedure
  409.  
  410. (complete 5)
  411. (if (> 2 @user-level) ; ask if expert user wishes to check PGP binary
  412.     (
  413.         (set choice 1) ; novice and average get this by default
  414.     )
  415.     (
  416.         (set choice (askbool (prompt #asksumming-prompt) (help #asksumming-help) (choices #yes #no) (default 1)))
  417.     )
  418. )
  419. (complete 10)
  420. (if (= choice 1) ; yes, a check is wanted
  421.         (
  422.         (working #pgpsumming)
  423. ;        (if (<> newpgpbinsum (getsum(newpgpbin))) ; checking
  424. ;            (abort #badpgpmsg) ; abort if not what was expected
  425.         (if (run "contrib/md5sum/md5sum -c Readme.Amiga" (safe))
  426.             (
  427.                 (abort #badpgpmsg)
  428.             )
  429.         )
  430.     )
  431. )
  432.  
  433.  
  434.  
  435. ; ***********************************************************
  436. ; * Discover if PGP is already installed.
  437. ; * And if so, find where the binary and support files are
  438. ; ***********************************************************
  439.  
  440. (complete 13)
  441.  
  442. (if (exists "ENV:PGPPATH")
  443.     (
  444.                 (set pgppath (getenv "PGPPATH"))
  445.         (if (run "C:Which PGP NoRes" (safe))
  446.             (
  447.                 (set pgpbinpath  (tackon @default-dest "PGP"))
  448.             )
  449.             (
  450.                 (run "setenv pgpinstall.tmp `C:Which PGP NoRes`" (safe))
  451.                 (set pgpbinpath (getenv "pgpinstall.tmp"))
  452.                         (set pgpbinpath (pathonly pgpbinpath))
  453.                 (delete "ENV:pgpinstall.tmp" (safe))
  454.             )
  455.         )
  456.         (set pgpexists TRUE)
  457.     )
  458.     (
  459.                 (set pgpexists FALSE)
  460.                 (set pgpbinpath (tackon @default-dest "PGP"))
  461.                 (set pgppath (tackon @default-dest "PGP"))
  462.     )
  463. )
  464.  
  465.  
  466.  
  467. (complete 15)
  468. ; ***********************************************************
  469. ; * Discover if and where AmigaGuide files are kept
  470. ; ***********************************************************
  471.  
  472. (if (exists "libs:amigaguide.library") ; see if AmigaGuide lib exists
  473.  
  474.     ; AmigaGuide exists
  475.         (
  476.      (set agexists TRUE)
  477.      (if (exists "ENV:AmigaGuide/Path")
  478.         ( ; AmigaGuide user that read the manual
  479.                     (set agpath (getenv "AmigaGuide/Path")) ; my personal favorite
  480.  
  481.             ; This is a little Installer program that will parse an ENV:
  482.             ; variable and return the first item in the variable
  483.  
  484.             (set maxn (strlen agpath))
  485.             (set n 0)
  486.             (set inquote FALSE)
  487.             (set agtmp "")
  488.             (set afterlead FALSE)
  489.  
  490.             (while (<= n maxn)
  491.                 (
  492.                     (set skipchar FALSE)    ; quotes can't be part of the path
  493.                                 ; so they must not be copied
  494.  
  495.                     (set char (substr agpath n 1)) ; get character
  496.  
  497.                     (if (AND (= " " char) (NOT afterlead)) ; skip any leading space
  498.                         (
  499.                                         (set skipchar TRUE)
  500.                                     )
  501.                     )
  502.  
  503.                     (if (AND (= char "\"") inquote) ; end of quote?
  504.                         (
  505.                             (set n maxn)        ; end quote
  506.                             (set skipchar TRUE) ; skip this char
  507.                         )
  508.                     )
  509.  
  510.                     (if (AND (= char "\"") (NOT inquote)) ; start of quote?
  511.                         (
  512.                             (set inquote TRUE)  ; start quote
  513.                             (set skipchar TRUE) ; skip this char
  514.                         )
  515.                             )
  516.  
  517.                             (if (AND afterlead (AND (NOT inquote) (OR (= char " ") (= char "\0")))) ; check if space or NULL and not in a quote
  518.                         (
  519.                             (set n maxn) ; found end of a path, get out
  520.                         )
  521.                             )
  522.  
  523.                             (if (NOT skipchar)
  524.                                     (
  525.                             (set agtmp (cat agtmp char))
  526.                             (set afterlead TRUE)
  527.                         )
  528.                     )
  529.  
  530.                     (set n (+ n 1))
  531.                 )
  532.             )
  533.  
  534.             (set agpath agtmp)
  535.         )
  536.         (
  537.                         (if (exists (tackon "HELP:" @language))
  538.                 ( ; OS2.1 or later
  539.                     (set agpath (tackon "HELP:" @language))
  540.                 )
  541.                 ( ; OS2.04 (AmigaGuide not included)
  542.                     (set agpath "S:")
  543.                 )
  544.                         )
  545.         )
  546.      )
  547.     ) ;end amigaguide exists
  548.  
  549.     ; AmigaGuide does not exist, AmigaGuide files will be placed
  550.     ; in the default destination
  551.     (
  552.      (set agexists FALSE)
  553.     )
  554. )
  555. (complete 18)
  556.  
  557.  
  558.  
  559. ; ***********************************************************
  560. ; * Ask where to install various PGP stuff
  561. ; ***********************************************************
  562.  
  563. ; make sure user really wants to install PGP binary here
  564. (set pgpbinpath (askdir (prompt #pgp-bin-prompt) (help #pgp-bin-help) (default pgpbinpath) (newpath)))
  565.  
  566. (complete 20)
  567. ; make sure user really wants to install PGP support here
  568. (set pgppath (askdir (prompt #pgp-path-prompt) (help #pgp-path-help) (default pgppath) (newpath)))
  569.  
  570. (complete 23)
  571. ; See if PGP might really be installed even though no ENV: variable
  572. ; This is necessary for the config stuff below
  573. (if (exists (tackon pgppath pgpconfig))
  574.     (
  575.         (set pgpexists TRUE)  ; PGP really does exist at where the
  576.     )                             ; users wants to install
  577.     (
  578.         (set pgpexists FALSE) ; PGP does NOT exist where the user
  579.     )                             ; wants to install
  580.                                       ; But it might really exist someplace else
  581. )
  582.  
  583.  
  584. (set @default-dest pgppath) ; when in doubt - the default destination
  585.  
  586. (complete 25)
  587. ; Ask where to install AmigaGuide files
  588. (if agexists
  589.     (       ; make sure user really wants to install PGP AmigaGuide files here
  590.         (set agpath (askdir (prompt #pgp-ag-prompt) (help #pgp-ag-help) (default agpath) (newpath)))
  591.     )
  592.     (       ; User does not have AmigaGuide, but still needs the files for documentation
  593.         (set agpath pgppath)
  594.     )
  595. )
  596.  
  597.  
  598.  
  599. ; ***********************************************************
  600. ; * Discover if user is trying to install an older PGP
  601. ; ***********************************************************
  602.  
  603. (complete 27)
  604. (if pgpexists
  605.     (
  606.         (set oldpgpbin (tackon pgpbinpath "PGP"))
  607.         (if (exists oldpgpbin)
  608.             (
  609.                 (if (= (getsize oldpgpbin) newpgpbinsize)
  610.                     (
  611.                         (if(askbool (prompt #already-installed) (help #already-installed-help) (default 0) (choices #yes #no))
  612.                                   (set donothing TRUE)
  613.                             (abort #already-installed-abort)
  614.                                  )
  615.                             )
  616.                                     (
  617.                          (if (earlier newpgpbin oldpgpbin)
  618.                             (
  619.                                 (if(askbool (prompt #old-installed) (help #old-installed-help) (default 0) (choices #yes #no))
  620.                                           (set donothing TRUE)
  621.                                     (abort #old-installed-abort)
  622.                                          )
  623.                                     )
  624.                              )
  625.                     )
  626.                 )
  627.             )
  628.         )
  629.     )
  630. )
  631.  
  632.  
  633.  
  634. ; ***********************************************************
  635. ; * Install PGP binary
  636. ; ***********************************************************
  637.  
  638. (complete 30)
  639. (copyfiles (prompt #working-pgp-bin) (help (cat #pgp-bin-help "\n\n" @copyfiles-help)) (source newpgpbin) (dest pgpbinpath) (files) (confirm))
  640.  
  641.  
  642.  
  643. ; ***********************************************************
  644. ; * Install PGP support files
  645. ; ***********************************************************
  646.  
  647. ; for novice user, do not install new configuration file unless
  648. ;  this is a new installation.
  649. ; for intermediate or expert, offer to backup old configuration first
  650.  
  651. (if pgpexists
  652.     (
  653.         (complete 35)
  654.         (set config-choice (askchoice (prompt #config-backup-prompt) (help #config-backup-help) (choices #config-backup-choices1 #config-backup-choices2 #config-backup-choices3)))
  655.                 (if (= 2 config-choice)
  656.             (       ; backup old configuration
  657.                 (complete 40)
  658.                                 (set sourceconfig (cat (tackon pgppath pgpconfig)))
  659.                 (set destconfig (cat pgpconfig ".bak"))
  660.                 (copyfiles (prompt #working-config-backup) (help (cat #working-config-backup "\n\n" @copyfiles-help)) (source sourceconfig) (dest pgppath) (newname destconfig) (files) (confirm))
  661.                         )
  662.         )
  663.         (if (< 0 config-choice)
  664.                         (       ; user wnats new Config file
  665.                 (complete 45)
  666.                 (copyfiles (prompt #working-pgp-etc) (help (cat #working-pgp-etc "\n\n" @copyfiles-help)) (source newpgpconfig) (dest pgppath) (files) (confirm))
  667.             )
  668.         )
  669.     )
  670.     (       ; new installation, so new Config file needed (redundant!)
  671.         (complete 40)
  672.         (copyfiles (prompt #working-pgp-etc) (help (cat #working-pgp-etc "\n\n" @copyfiles-help)) (source newpgpconfig) (dest pgppath) (files) (confirm))
  673.     )
  674. )
  675.  
  676. ; install rest of support files
  677.  
  678. (complete 45)
  679.  
  680. (copyfiles (prompt #working-pgp-etc) (help (cat #working-pgp-etc "\n\n" @copyfiles-help)) (choices "bin/es.hlp" "bin/fr.hlp" "bin/keys.asc" "bin/language.txt" "bin/pgp.hlp" "doc/keyserv.doc" "doc/newfor22.doc" "doc/newfor23.doc" "doc/pgformat.doc" "doc/PGP.faq" "doc/politic.doc" "doc/readme.doc" "doc/setup.doc") (dest pgppath) (source "") (files) (confirm))
  681.  
  682.  
  683.  
  684. ; ***********************************************************
  685. ; * Install PGP AmigaGuide files
  686. ; ***********************************************************
  687.  
  688. ; For non-AmigaGuide system, AmigaGuide files will be copied with
  689. ; the rest of the PGP support files.
  690. ; For AmigaGuide system, AmigaGuide files will be copied to
  691. ; the following (in order):
  692. ;    1. User-Specified location
  693. ;     2. ENV:AmigaGuide/Path setting
  694. ;    3. HELP:(language) where language is the language in use
  695. ;    4. S: for OS2.04 systems that added AmigaGuide and haven't
  696. ;             bothered to set a special place for AmigaGuide files
  697.  
  698. (complete 75)
  699.  
  700. (copyfiles (prompt #working-ag) (help (cat #working-ag "\n\n" @copyfiles-help)) (source "") (dest agpath) (choices "doc/pgpdoc1.guide" "doc/pgpdoc2.guide") (files) (confirm))
  701.  
  702.  
  703.  
  704. ; ***********************************************************
  705. ; * Set up ENV: and ENVARC: to point to where PGP was installed
  706. ; ***********************************************************
  707.  
  708. (if (NOT pgpexists) ; Don't do anything if this is an upgrade
  709.     (       ;set ENV:
  710.         (complete 85)
  711.         (textfile (prompt #working-env-prompt) (help #working-env-help) (dest "ENV:PGPPATH") (append (expandpath pgppath)) (confirm))
  712.             ;set ENVARC:
  713.         (complete 90)
  714.         (textfile (prompt #working-env-prompt) (help #working-env-help) (dest "ENVARC:PGPPATH") (append (expandpath pgppath)) (confirm))
  715.     )
  716. )
  717.  
  718.  
  719.  
  720. ; ***********************************************************
  721. ; * Installation basically complete, just show the readme now
  722. ; ***********************************************************
  723.  
  724. ; View readme with:
  725. ;    1. ENV:PAGER
  726. ;    2. More if not OS 3.x
  727. ;    3. Multiview if OS 3.x
  728.  
  729. ; NOTE: This has problems when run from workbench, which is
  730. ;       why full paths are given below.
  731.  
  732. (if (exists "ENV:PAGER")
  733.     (
  734.         (set pager (getenv "PAGER"))
  735.     )
  736.         (
  737.                 (if (< osver 39)
  738.             (
  739.                                 (set pager "SYS:Utilities/More")
  740.             )
  741.             (
  742.                 (set pager "SYS:Utilities/Multiview")
  743.                 )
  744.         )
  745.     )
  746. )
  747.  
  748.  
  749. (complete 95) ; 95% done
  750.  
  751.  
  752. (if (> 2 @user-level) ; ask expert if they wish NOT to view the readme
  753.     (
  754.         (set choice 1) ; default yes
  755.     )
  756.     (
  757.         (set choice (askbool (prompt #ask-view-prompt) (help #ask-view-help) (choices #yes #no) (default 1)))
  758.     )
  759. )
  760. (if (= choice 1) ; yes, they want to read it
  761.         (run (cat pager " ReadMe.Amiga") (safe))
  762. )
  763.  
  764. (complete 100) ; 100% done
  765.  
  766. ; The end! Phew!
  767.